#include"servercal.hpp"
#include"TcpServer.hpp"

void Usage(std::string proc)
{
    std::cout<<"\nUsage:"<<proc<<" serverport"<<std::endl;
}
int main(int argc,char* argv[])
{
    if(argc!=2)
    {
        Usage(argv[0]);
        exit(0);
    }
    uint16_t port=std::stoi(argv[1]);
    Servercal cal;
    TcpServer*tp=new TcpServer(port,std::bind(&Servercal::Calculator,&cal,std::placeholders::_1));
    tp->Init();
    tp->Start();
    return 0;
}